#ifdef HAVE_CONFIG_H
#        include <config.h>
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>

#include "support.h"
#include "addgroup.h"
#include "clist.h"
#include "newwindow.h"

#define GLADE_HOOKUP_OBJECT(component,widget,name) \
        g_object_set_data_full (G_OBJECT (component), name, \
                gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)

#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
        g_object_set_data (G_OBJECT (component), name, widget)


GtkWidget*
create_window_add_group (struct addgroup_struct *addgroup,struct clist_struct *clist)
{
  	GtkWidget *window;
  	window=(GtkWidget *)create_new_add_window (addgroup,clist);
	gtk_window_set_title (GTK_WINDOW (window), _(
					"\346\267\273\345\212\240\345\210\206\347\273\204"));
	gtk_window_set_icon_name (GTK_WINDOW (window), "gtk-add");
	
	
	 g_signal_connect ((gpointer) window, "destroy",
                    G_CALLBACK (on_window_add_group_destroy),
                    NULL);
	g_signal_connect ((gpointer) addgroup->button_cancel, "clicked",
                    G_CALLBACK (on_button_add_group_cancel_clicked),
                    (gpointer)window);
	g_signal_connect ((gpointer) addgroup->button_ok, "clicked",
                    G_CALLBACK (on_button_add_group_ok_clicked),
                    (gpointer)addgroup);
	g_signal_connect ((gpointer) addgroup->button_help, "clicked",
                    G_CALLBACK (on_button_add_group_help_clicked),
                    NULL);
                    
	return window;
}
